#include<iostream>
#include<algorithm>

using namespace std;

const int N=3010;

char str[N];
int n,sum,ant;


int main()
{
	cin>>n>>str;
	
	for(int i=0;i<n;i++){
		if(str[i]=='L') sum-=ant;
		else if(str[i]=='R'){
			int ans;  
			for(ans=i;;ans++){
				if(ans==n) break;
				if(str[ans]=='L'){
					ant=0;
					sum+=(ans-i+1)&1; 
					break;
				} 
			}
			i=ans;
		}
		else  ant++,sum++;
	}
	
	cout<<sum<<endl;
	
	return 0;
}
